
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.VyearCollegeDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class VyearCollegeDaoJdbc extends BaseDaoJdbc implements VyearCollegeDao {
	String tableName="V_YEAR_COLLEGE";
	String beanName="vyearCollege";
	
	public CommonBean createVyearCollege(){
		CommonBean vyearColleges=this.createBean(tableName,beanName);
                return vyearColleges;		
	}
	
/*
	public CommonBean findVyearColleges(String refid) {
		CommonBean vyearColleges=this.createVyearCollege();
		String sql="select * from V_YEAR_COLLEGE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		vyearColleges.addData(data);
                return vyearColleges;
       }
*/
	public CommonBean findVyearCollegeById(String id) {
		CommonBean vyearColleges=this.createVyearCollege();
		String sql="select * from V_YEAR_COLLEGE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		vyearColleges.addData(data);
    return vyearColleges;
  }
  
	public CommonBean findAllVyearColleges() {
		CommonBean vyearColleges=this.createVyearCollege();
		String sql="select * from V_YEAR_COLLEGE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		vyearColleges.addData(data);
    return vyearColleges;
  }
	public void insertVyearCollege(CommonBean vyearCollegeBean){
		List data=vyearCollegeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updateVyearCollege(CommonBean vyearCollegeBean){
		List data=vyearCollegeBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

